import Vue from 'vue'
import VueRouter from 'vue-router'
// import Login from '@/views/Login'
// import Home from '@/views/Home'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/article_detail',
    component: () => import('@/views/ArticleDetail')
  },
  {
    path: '/search',
    component: () => import('@/views/Search')
  },
  {
    path: '/search/:keywords',
    component: () => import('@/views/SearchResult')
  },
  {
    path: '/UserEditor',
    component: () => import('@/views/User/UserEdit.vue')
  },
  {
    path: '/login',
    component: () => import('@/views/Login')
  },
  {
    path: '/chat',
    component: () => import('@/views/Chat')
  },

  {
    path: '/layout',
    redirect: '/layout/home',
    component: () => import('@/views/Layout'),
    children: [
      {
        path: 'home',
        component: () => import('@/views/Home')
      },
      {
        path: 'user',
        component: () => import('@/views/User')
      }

    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
